Skip to main content
POST
/
v1
/
transports
/
bulk-delete
Bulk Delete Transport Routes
const options = {
  method: 'POST',
  headers: {'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));
{
  "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

Authentication

Supports both authentication methods:
x-api-key
string
Your API key (use this or Authorization)Example: sk_live_1234567890abcdef
Authorization
string
Bearer JWT token (use this or x-api-key)Example: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...

Headers

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"
    ]
  }'

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