Batch Delete Logistics Requests
const options = {
method: 'POST',
headers: {
'x-api-key': '<x-api-key>',
'x-organization-id': '<x-organization-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({request_ids: {}})
};
fetch('https://api.dcycle.io/v1/logistics/requests/batch-delete', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dcycle.io/v1/logistics/requests/batch-delete"
payload = { "request_ids": {} }
headers = {
"x-api-key": "<x-api-key>",
"x-organization-id": "<x-organization-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://api.dcycle.io/v1/logistics/requests/batch-delete \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>' \
--data '
{
"request_ids": {}
}
'Batch Delete Logistics Requests
Delete multiple logistics requests (shipments) in a single operation
POST
/
v1
/
logistics
/
requests
/
batch-delete
Batch Delete Logistics Requests
const options = {
method: 'POST',
headers: {
'x-api-key': '<x-api-key>',
'x-organization-id': '<x-organization-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({request_ids: {}})
};
fetch('https://api.dcycle.io/v1/logistics/requests/batch-delete', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dcycle.io/v1/logistics/requests/batch-delete"
payload = { "request_ids": {} }
headers = {
"x-api-key": "<x-api-key>",
"x-organization-id": "<x-organization-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://api.dcycle.io/v1/logistics/requests/batch-delete \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>' \
--data '
{
"request_ids": {}
}
'Batch Delete Logistics Requests
Delete multiple logistics requests in a single API call. This is more efficient than making individual delete calls when removing multiple records.Permanent Action: Deleting logistics requests is permanent and cannot be undone. All associated emissions data will be removed from your organization’s totals.
Request
Headers
string
required
Your API key for authenticationExample:
sk_live_1234567890abcdefstring
required
Your organization UUIDExample:
a8315ef3-dd50-43f8-b7ce-d839e68d51faBody Parameters
array[string]
required
Array of logistics request UUIDs to deleteExample:
["550e8400-e29b-41d4-a716-446655440000", "660e8400-e29b-41d4-a716-446655440001"]Response
Returns204 No Content on successful deletion.
Example
curl -X POST "https://api.dcycle.io/v1/logistics/requests/batch-delete" \
-H "x-api-key: ${DCYCLE_API_KEY}" \
-H "x-organization-id: ${DCYCLE_ORG_ID}" \
-H "Content-Type: application/json" \
-d '{
"request_ids": [
"550e8400-e29b-41d4-a716-446655440000",
"660e8400-e29b-41d4-a716-446655440001"
]
}'
import requests
import os
api_key = os.getenv("DCYCLE_API_KEY")
org_id = os.getenv("DCYCLE_ORG_ID")
headers = {
"x-api-key": api_key,
"x-organization-id": org_id,
"Content-Type": "application/json"
}
payload = {
"request_ids": [
"550e8400-e29b-41d4-a716-446655440000",
"660e8400-e29b-41d4-a716-446655440001"
]
}
response = requests.post(
"https://api.dcycle.io/v1/logistics/requests/batch-delete",
headers=headers,
json=payload
)
if response.status_code == 204:
print(f"Deleted {len(payload['request_ids'])} logistics requests")
else:
print(f"Error: {response.json()}")
const axios = require('axios');
const apiKey = process.env.DCYCLE_API_KEY;
const orgId = process.env.DCYCLE_ORG_ID;
const headers = {
'x-api-key': apiKey,
'x-organization-id': orgId,
'Content-Type': 'application/json'
};
const payload = {
request_ids: [
'550e8400-e29b-41d4-a716-446655440000',
'660e8400-e29b-41d4-a716-446655440001'
]
};
axios.post(
'https://api.dcycle.io/v1/logistics/requests/batch-delete',
payload,
{ headers }
)
.then(response => {
if (response.status === 204) {
console.log(`Deleted ${payload.request_ids.length} logistics requests`);
}
})
.catch(error => console.error(error));
Successful Response
HTTP/1.1 204 No Content
Common Errors
401 Unauthorized
Cause: Missing or invalid API key{
"detail": "Invalid API key",
"code": "INVALID_API_KEY"
}
404 Not Found
Cause: One or more request IDs not found or don’t belong to your organization{
"code": "NOT_FOUND",
"detail": "Logistics request not found"
}
422 Validation Error
Cause: Invalid request body format{
"detail": [
{
"loc": ["body", "request_ids"],
"msg": "field required",
"type": "value_error.missing"
}
]
}
Related Endpoints
Delete Single Request
Delete a single logistics request
Get Logistics Requests
Retrieve logistics requests
Batch Delete Recharges
Delete multiple recharges at once
Was this page helpful?