Create
curl --request POST \
--url https://{defaultHost}/v1/bulk_actions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"bulk_action": {
"action_type": "delete_products",
"record_ids": [
"6b92c5de-88ea-4112-b2e3-fa86ec251ea7",
"938a643d-5864-46c0-828c-3ebc8570c6b1",
"45e12109-e4e3-4cff-a5c0-fdba03385455",
"e3eabe82-fcf3-4728-9d8d-48c049843623",
"fa2dbef5-c90f-439f-a7a6-06fa750a09c5"
]
}
}
'import requests
url = "https://{defaultHost}/v1/bulk_actions"
payload = { "bulk_action": {
"action_type": "delete_products",
"record_ids": ["6b92c5de-88ea-4112-b2e3-fa86ec251ea7", "938a643d-5864-46c0-828c-3ebc8570c6b1", "45e12109-e4e3-4cff-a5c0-fdba03385455", "e3eabe82-fcf3-4728-9d8d-48c049843623", "fa2dbef5-c90f-439f-a7a6-06fa750a09c5"]
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
bulk_action: {
action_type: 'delete_products',
record_ids: [
'6b92c5de-88ea-4112-b2e3-fa86ec251ea7',
'938a643d-5864-46c0-828c-3ebc8570c6b1',
'45e12109-e4e3-4cff-a5c0-fdba03385455',
'e3eabe82-fcf3-4728-9d8d-48c049843623',
'fa2dbef5-c90f-439f-a7a6-06fa750a09c5'
]
}
})
};
fetch('https://{defaultHost}/v1/bulk_actions', 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://{defaultHost}/v1/bulk_actions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'bulk_action' => [
'action_type' => 'delete_products',
'record_ids' => [
'6b92c5de-88ea-4112-b2e3-fa86ec251ea7',
'938a643d-5864-46c0-828c-3ebc8570c6b1',
'45e12109-e4e3-4cff-a5c0-fdba03385455',
'e3eabe82-fcf3-4728-9d8d-48c049843623',
'fa2dbef5-c90f-439f-a7a6-06fa750a09c5'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{defaultHost}/v1/bulk_actions"
payload := strings.NewReader("{\n \"bulk_action\": {\n \"action_type\": \"delete_products\",\n \"record_ids\": [\n \"6b92c5de-88ea-4112-b2e3-fa86ec251ea7\",\n \"938a643d-5864-46c0-828c-3ebc8570c6b1\",\n \"45e12109-e4e3-4cff-a5c0-fdba03385455\",\n \"e3eabe82-fcf3-4728-9d8d-48c049843623\",\n \"fa2dbef5-c90f-439f-a7a6-06fa750a09c5\"\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{defaultHost}/v1/bulk_actions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"bulk_action\": {\n \"action_type\": \"delete_products\",\n \"record_ids\": [\n \"6b92c5de-88ea-4112-b2e3-fa86ec251ea7\",\n \"938a643d-5864-46c0-828c-3ebc8570c6b1\",\n \"45e12109-e4e3-4cff-a5c0-fdba03385455\",\n \"e3eabe82-fcf3-4728-9d8d-48c049843623\",\n \"fa2dbef5-c90f-439f-a7a6-06fa750a09c5\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/bulk_actions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"bulk_action\": {\n \"action_type\": \"delete_products\",\n \"record_ids\": [\n \"6b92c5de-88ea-4112-b2e3-fa86ec251ea7\",\n \"938a643d-5864-46c0-828c-3ebc8570c6b1\",\n \"45e12109-e4e3-4cff-a5c0-fdba03385455\",\n \"e3eabe82-fcf3-4728-9d8d-48c049843623\",\n \"fa2dbef5-c90f-439f-a7a6-06fa750a09c5\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "1fdbf638-f862-46e7-8d0b-10325b9c4c08",
"object": "bulk_action",
"action_type": "delete_products",
"record_ids": [
"6b92c5de-88ea-4112-b2e3-fa86ec251ea7",
"938a643d-5864-46c0-828c-3ebc8570c6b1",
"45e12109-e4e3-4cff-a5c0-fdba03385455",
"e3eabe82-fcf3-4728-9d8d-48c049843623",
"fa2dbef5-c90f-439f-a7a6-06fa750a09c5"
],
"skipped_record_ids": [],
"status": "processing",
"created_at": 1793796850,
"updated_at": 1793796850
}Bulk Actions
Create
Creates a new bulk action.
POST
/
v1
/
bulk_actions
Create
curl --request POST \
--url https://{defaultHost}/v1/bulk_actions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"bulk_action": {
"action_type": "delete_products",
"record_ids": [
"6b92c5de-88ea-4112-b2e3-fa86ec251ea7",
"938a643d-5864-46c0-828c-3ebc8570c6b1",
"45e12109-e4e3-4cff-a5c0-fdba03385455",
"e3eabe82-fcf3-4728-9d8d-48c049843623",
"fa2dbef5-c90f-439f-a7a6-06fa750a09c5"
]
}
}
'import requests
url = "https://{defaultHost}/v1/bulk_actions"
payload = { "bulk_action": {
"action_type": "delete_products",
"record_ids": ["6b92c5de-88ea-4112-b2e3-fa86ec251ea7", "938a643d-5864-46c0-828c-3ebc8570c6b1", "45e12109-e4e3-4cff-a5c0-fdba03385455", "e3eabe82-fcf3-4728-9d8d-48c049843623", "fa2dbef5-c90f-439f-a7a6-06fa750a09c5"]
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
bulk_action: {
action_type: 'delete_products',
record_ids: [
'6b92c5de-88ea-4112-b2e3-fa86ec251ea7',
'938a643d-5864-46c0-828c-3ebc8570c6b1',
'45e12109-e4e3-4cff-a5c0-fdba03385455',
'e3eabe82-fcf3-4728-9d8d-48c049843623',
'fa2dbef5-c90f-439f-a7a6-06fa750a09c5'
]
}
})
};
fetch('https://{defaultHost}/v1/bulk_actions', 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://{defaultHost}/v1/bulk_actions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'bulk_action' => [
'action_type' => 'delete_products',
'record_ids' => [
'6b92c5de-88ea-4112-b2e3-fa86ec251ea7',
'938a643d-5864-46c0-828c-3ebc8570c6b1',
'45e12109-e4e3-4cff-a5c0-fdba03385455',
'e3eabe82-fcf3-4728-9d8d-48c049843623',
'fa2dbef5-c90f-439f-a7a6-06fa750a09c5'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{defaultHost}/v1/bulk_actions"
payload := strings.NewReader("{\n \"bulk_action\": {\n \"action_type\": \"delete_products\",\n \"record_ids\": [\n \"6b92c5de-88ea-4112-b2e3-fa86ec251ea7\",\n \"938a643d-5864-46c0-828c-3ebc8570c6b1\",\n \"45e12109-e4e3-4cff-a5c0-fdba03385455\",\n \"e3eabe82-fcf3-4728-9d8d-48c049843623\",\n \"fa2dbef5-c90f-439f-a7a6-06fa750a09c5\"\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{defaultHost}/v1/bulk_actions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"bulk_action\": {\n \"action_type\": \"delete_products\",\n \"record_ids\": [\n \"6b92c5de-88ea-4112-b2e3-fa86ec251ea7\",\n \"938a643d-5864-46c0-828c-3ebc8570c6b1\",\n \"45e12109-e4e3-4cff-a5c0-fdba03385455\",\n \"e3eabe82-fcf3-4728-9d8d-48c049843623\",\n \"fa2dbef5-c90f-439f-a7a6-06fa750a09c5\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/bulk_actions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"bulk_action\": {\n \"action_type\": \"delete_products\",\n \"record_ids\": [\n \"6b92c5de-88ea-4112-b2e3-fa86ec251ea7\",\n \"938a643d-5864-46c0-828c-3ebc8570c6b1\",\n \"45e12109-e4e3-4cff-a5c0-fdba03385455\",\n \"e3eabe82-fcf3-4728-9d8d-48c049843623\",\n \"fa2dbef5-c90f-439f-a7a6-06fa750a09c5\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "1fdbf638-f862-46e7-8d0b-10325b9c4c08",
"object": "bulk_action",
"action_type": "delete_products",
"record_ids": [
"6b92c5de-88ea-4112-b2e3-fa86ec251ea7",
"938a643d-5864-46c0-828c-3ebc8570c6b1",
"45e12109-e4e3-4cff-a5c0-fdba03385455",
"e3eabe82-fcf3-4728-9d8d-48c049843623",
"fa2dbef5-c90f-439f-a7a6-06fa750a09c5"
],
"skipped_record_ids": [],
"status": "processing",
"created_at": 1793796850,
"updated_at": 1793796850
}Authorizations
Response
200 - application/json
Success
The status of the bulk action. Possible values include:
completed: The bulk action has been executed, possibly with some errors.invalid: The bulk action contains no record_ids that support the given action.pending: The bulk action is pending and not yet processed.processing: The bulk action is currently being processed.succeeded: The bulk action has succeeded with no errors for all the supporting record_ids.
Was this page helpful?