Skip to main content
POST
/
v1
/
transports
/
bulk-delete
Bulk Delete Transport Routes
const options = {
  method: 'POST',
  headers: {
    'x-api-key': '<x-api-key>',
    'x-organization-id': '<x-organization-id>',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({transport_ids: [{}]})
};

fetch('https://api.dcycle.io/v1/transports/bulk-delete', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
import requests

url = "https://api.dcycle.io/v1/transports/bulk-delete"

payload = { "transport_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/transports/bulk-delete \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <x-api-key>' \
  --header 'x-organization-id: <x-organization-id>' \
  --data '
{
  "transport_ids": [
    {}
  ]
}
'
{
  "success_count": 123,
  "success_ids": [
    {}
  ],
  "failed_count": 123,
  "failed_ids": [
    {}
  ],
  "message": "<string>"
}

Bulk Delete Transport Routes

Delete multiple transport routes at once by providing a list of IDs. All associated transport sections and their total_impacts records are removed automatically. Progress is tracked asynchronously and a notification is published via SSE when the operation completes. IDs that do not exist or belong to a different organization are silently reported as failures in the response — the rest of the batch still proceeds.

Request

Headers

x-api-key
string
required
Your API key for authenticationExample: sk_live_1234567890abcdef
x-organization-id
string
required
Your organization UUIDExample: a8315ef3-dd50-43f8-b7ce-d839e68d51fa

Body

transport_ids
array
required
List of transport route UUIDs to delete. Minimum 1, maximum 100,000 per request.Example: ["010ed3b6-b513-40f3-b9fe-0f0a338d9274", "550e8400-e29b-41d4-a716-446655440000"]

Response

success_count
integer
Number of transport routes successfully deleted
success_ids
array
UUIDs of the transport routes that were successfully deleted
failed_count
integer
Number of transport routes that could not be deleted
failed_ids
array
UUIDs of the transport routes that failed (e.g. ID not found or belongs to a different organization)
message
string
Human-readable summary of the operation outcome
A partial success is possible: if some IDs fail validation the rest are still deleted. Check failed_ids to identify which routes were not removed and why.

Example

curl -X POST "https://api.dcycle.io/v1/transports/bulk-delete" \
  -H "x-api-key: ${DCYCLE_API_KEY}" \
  -H "x-organization-id: ${DCYCLE_ORG_ID}" \
  -H "Content-Type: application/json" \
  -d '{
    "transport_ids": [
      "010ed3b6-b513-40f3-b9fe-0f0a338d9274",
      "550e8400-e29b-41d4-a716-446655440000",
      "7c9e6679-7425-40de-944b-e07fc1f90ae7"
    ]
  }'
curl -X POST "https://api.dcycle.io/v1/transports/bulk-delete" \
  -H "x-organization-id: ${DCYCLE_ORG_ID}" \
  -H "Content-Type: application/json" \
  -d '{
    "transport_ids": [
      "010ed3b6-b513-40f3-b9fe-0f0a338d9274",
      "550e8400-e29b-41d4-a716-446655440000",
      "7c9e6679-7425-40de-944b-e07fc1f90ae7"
    ]
  }'
import requests
import os

transport_ids = [
    "010ed3b6-b513-40f3-b9fe-0f0a338d9274",
    "550e8400-e29b-41d4-a716-446655440000",
    "7c9e6679-7425-40de-944b-e07fc1f90ae7",
]

response = requests.post(
    "https://api.dcycle.io/v1/transports/bulk-delete",
    headers={
        "x-api-key": os.getenv("DCYCLE_API_KEY"),
        "x-organization-id": os.getenv("DCYCLE_ORG_ID"),
    },
    json={"transport_ids": transport_ids},
)

result = response.json()
print(f"Deleted: {result['success_count']} routes")
if result["failed_ids"]:
    print(f"Failed IDs: {result['failed_ids']}")
const axios = require('axios');

const transportIds = [
  '010ed3b6-b513-40f3-b9fe-0f0a338d9274',
  '550e8400-e29b-41d4-a716-446655440000',
  '7c9e6679-7425-40de-944b-e07fc1f90ae7',
];

axios.post(
  'https://api.dcycle.io/v1/transports/bulk-delete',
  { transport_ids: transportIds },
  {
    headers: {
      'x-api-key': process.env.DCYCLE_API_KEY,
      'x-organization-id': process.env.DCYCLE_ORG_ID,
    },
  },
)
.then(({ data }) => {
  console.log(`Deleted: ${data.success_count} routes`);
  if (data.failed_ids.length > 0) {
    console.log('Failed IDs:', data.failed_ids);
  }
})
.catch(error => console.error(error));

Successful Response

{
  "success_count": 2,
  "success_ids": [
    "010ed3b6-b513-40f3-b9fe-0f0a338d9274",
    "550e8400-e29b-41d4-a716-446655440000"
  ],
  "failed_count": 1,
  "failed_ids": [
    "7c9e6679-7425-40de-944b-e07fc1f90ae7"
  ],
  "message": "Successfully deleted 2 transport route(s), 1 failed or not found"
}

All routes deleted

{
  "success_count": 3,
  "success_ids": [
    "010ed3b6-b513-40f3-b9fe-0f0a338d9274",
    "550e8400-e29b-41d4-a716-446655440000",
    "7c9e6679-7425-40de-944b-e07fc1f90ae7"
  ],
  "failed_count": 0,
  "failed_ids": [],
  "message": "Successfully deleted 3 transport route(s)"
}

Common Errors

401 Unauthorized

Cause: Missing or invalid API key / JWT token
{"detail": "Invalid API key for organization", "code": "INVALID_API_KEY"}

403 Forbidden

Cause: The authenticated user is not a member of the organization
{"detail": "Logged User is not Member of Organization", "code": "LOGGED_USER_NOT_MEMBER"}

422 Unprocessable Entity

Cause: transport_ids is empty or exceeds 100,000 items
{
  "detail": [
    {
      "loc": ["body", "transport_ids"],
      "msg": "ensure this value has at least 1 items",
      "type": "value_error.list.min_items"
    }
  ]
}

List Transport Routes

Retrieve all transport routes with filtering and pagination

Bulk Delete by Filters

Delete all routes matching a set of filters at once

Delete Transport Route

Delete a single transport route by ID

Transport Overview

Full data model and distance calculation reference