Skip to main content
POST
/
v1
/
projects
/
{project_id}
/
entities
/
unlink
Unlink Entities from Project
const options = {
  method: 'POST',
  headers: {
    'x-api-key': '<x-api-key>',
    'x-organization-id': '<x-organization-id>',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({entity_type: '<string>', entity_ids: {}})
};

fetch('https://api.dcycle.io/v1/projects/{project_id}/entities/unlink', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
import requests

url = "https://api.dcycle.io/v1/projects/{project_id}/entities/unlink"

payload = {
    "entity_type": "<string>",
    "entity_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/projects/{project_id}/entities/unlink \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <x-api-key>' \
  --header 'x-organization-id: <x-organization-id>' \
  --data '
{
  "entity_type": "<string>",
  "entity_ids": {}
}
'
{
  "deleted": 123
}

Unlink Entities from Project

Remove the association between entities and a project. The entities themselves are not deleted — they continue to exist at the organization level and can be re-linked to the same or different projects at any time.
New API: This endpoint is part of the new API architecture.

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

Path Parameters

project_id
string
required
The UUID of the project to unlink entities fromExample: b7f2a1c3-4d5e-6f7a-8b9c-0d1e2f3a4b5c

Body Parameters

entity_type
string
required
The type of entities being unlinked.Available values: logistic_requests, logistic_recharges, logistic_packages, invoices, file_readings
entity_ids
array[string]
required
List of entity UUIDs to unlink. Minimum 1, maximum 100 per request.Example: ["550e8400-e29b-41d4-a716-446655440000", "660e8400-e29b-41d4-a716-446655440001"]

Response

deleted
integer
Number of associations removed

Example

curl -X POST "https://api.dcycle.io/v1/projects/b7f2a1c3-4d5e-6f7a-8b9c-0d1e2f3a4b5c/entities/unlink" \
  -H "x-api-key: ${DCYCLE_API_KEY}" \
  -H "x-organization-id: ${DCYCLE_ORG_ID}" \
  -H "Content-Type: application/json" \
  -d '{
    "entity_type": "invoices",
    "entity_ids": [
      "550e8400-e29b-41d4-a716-446655440000"
    ]
  }'
import requests
import os

api_key = os.getenv("DCYCLE_API_KEY")
org_id = os.getenv("DCYCLE_ORG_ID")
project_id = "b7f2a1c3-4d5e-6f7a-8b9c-0d1e2f3a4b5c"

headers = {
    "x-api-key": api_key,
    "x-organization-id": org_id,
    "Content-Type": "application/json"
}

payload = {
    "entity_type": "invoices",
    "entity_ids": ["550e8400-e29b-41d4-a716-446655440000"]
}

response = requests.post(
    f"https://api.dcycle.io/v1/projects/{project_id}/entities/unlink",
    headers=headers,
    json=payload
)

result = response.json()
print(f"Unlinked: {result['deleted']} entities")
const axios = require('axios');

const apiKey = process.env.DCYCLE_API_KEY;
const orgId = process.env.DCYCLE_ORG_ID;
const projectId = 'b7f2a1c3-4d5e-6f7a-8b9c-0d1e2f3a4b5c';

const headers = {
  'x-api-key': apiKey,
  'x-organization-id': orgId,
  'Content-Type': 'application/json'
};

const payload = {
  entity_type: 'invoices',
  entity_ids: ['550e8400-e29b-41d4-a716-446655440000']
};

axios.post(
  `https://api.dcycle.io/v1/projects/${projectId}/entities/unlink`,
  payload,
  { headers }
)
.then(response => {
  console.log(`Unlinked: ${response.data.deleted} entities`);
})
.catch(error => console.error(error));

Successful Response

{
  "deleted": 1
}

Common Errors

401 Unauthorized

Cause: Missing or invalid API key
{"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"}

404 Not Found

Cause: The project does not exist or belongs to another organization
{"detail": "Not Found"}

422 Unprocessable Entity

Cause: Invalid entity type or missing entity IDs
{
  "detail": [
    {
      "loc": ["body", "entity_type"],
      "msg": "field required",
      "type": "value_error.missing"
    }
  ]
}

Link Entities

Link entities by ID to a project

Link by Filters

Bulk-link all entities matching a filter