Delete Project
const options = {
method: 'DELETE',
headers: {'x-api-key': '<x-api-key>', 'x-organization-id': '<x-organization-id>'}
};
fetch('https://api.dcycle.io/v1/projects/{project_id}', 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}"
headers = {
"x-api-key": "<x-api-key>",
"x-organization-id": "<x-organization-id>"
}
response = requests.delete(url, headers=headers)
print(response.text)curl --request DELETE \
--url https://api.dcycle.io/v1/projects/{project_id} \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>'Delete Project
Remove a project from your organization
DELETE
/
v1
/
projects
/
{project_id}
Delete Project
const options = {
method: 'DELETE',
headers: {'x-api-key': '<x-api-key>', 'x-organization-id': '<x-organization-id>'}
};
fetch('https://api.dcycle.io/v1/projects/{project_id}', 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}"
headers = {
"x-api-key": "<x-api-key>",
"x-organization-id": "<x-organization-id>"
}
response = requests.delete(url, headers=headers)
print(response.text)curl --request DELETE \
--url https://api.dcycle.io/v1/projects/{project_id} \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>'Delete Project
Permanently delete a project from your organization. This will remove the project and all its entity associations (linked invoices, logistics requests, etc.).Irreversible Action: Deleting a project permanently removes the project and all entity-project associations. The underlying entities (invoices, logistics requests, etc.) are NOT deleted — only their link to this project is removed.
Request
Headers
string
required
Your API key for authenticationExample:
sk_live_1234567890abcdefstring
required
Your organization UUIDExample:
a8315ef3-dd50-43f8-b7ce-d839e68d51faPath Parameters
string
required
The unique identifier (UUID) of the project to deleteExample:
550e8400-e29b-41d4-a716-446655440000Response
Returns204 No Content on successful deletion. No response body is returned.
Example
curl -X DELETE "https://api.dcycle.io/v1/projects/550e8400-e29b-41d4-a716-446655440000" \
-H "x-api-key: ${DCYCLE_API_KEY}" \
-H "x-organization-id: ${DCYCLE_ORG_ID}"
import requests
import os
api_key = os.getenv("DCYCLE_API_KEY")
org_id = os.getenv("DCYCLE_ORG_ID")
project_id = "550e8400-e29b-41d4-a716-446655440000"
headers = {
"x-api-key": api_key,
"x-organization-id": org_id
}
response = requests.delete(
f"https://api.dcycle.io/v1/projects/{project_id}",
headers=headers
)
if response.status_code == 204:
print("Project deleted successfully")
else:
print(f"Error: {response.text}")
const axios = require('axios');
const apiKey = process.env.DCYCLE_API_KEY;
const orgId = process.env.DCYCLE_ORG_ID;
const projectId = '550e8400-e29b-41d4-a716-446655440000';
const headers = {
'x-api-key': apiKey,
'x-organization-id': orgId
};
axios.delete(
`https://api.dcycle.io/v1/projects/${projectId}`,
{ headers }
)
.then(response => {
if (response.status === 204) {
console.log('Project deleted successfully');
}
})
.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: Project not found or doesn’t belong to your organization{
"detail": "Project not found"
}
422 Validation Error
Cause: Invalid project ID format{
"detail": [
{
"loc": ["path", "project_id"],
"msg": "value is not a valid uuid",
"type": "type_error.uuid"
}
]
}
Use Cases
Delete with Confirmation
Verify the project details before deleting:def delete_project_with_confirmation(project_id):
"""Delete project after reviewing its details"""
# Get project details first
response = requests.get(
f"https://api.dcycle.io/v1/projects/{project_id}",
headers=headers
)
if response.status_code != 200:
print("Project not found")
return False
project = response.json()
print(f"About to delete:")
print(f" Name: {project['name']}")
print(f" Type: {project['project_type']}")
print(f" Created: {project['created_at']}")
confirm = input("Delete this project? (yes/no): ")
if confirm.lower() == 'yes':
response = requests.delete(
f"https://api.dcycle.io/v1/projects/{project_id}",
headers=headers
)
return response.status_code == 204
return False
Clean Up Completed Projects
Remove projects that have ended and are no longer needed:import datetime
def cleanup_old_projects(months_after_end=6):
"""Delete projects that ended more than N months ago"""
response = requests.get(
"https://api.dcycle.io/v1/projects/extended",
headers=headers
)
cutoff = datetime.date.today() - datetime.timedelta(days=months_after_end * 30)
deleted = 0
for project in response.json():
if project["end_date"] and project["end_date"] < str(cutoff):
ext = project["extended"]
if ext["number_of_tasks"] == ext["number_of_tasks_completed"]:
response = requests.delete(
f"https://api.dcycle.io/v1/projects/{project['id']}",
headers=headers
)
if response.status_code == 204:
deleted += 1
print(f"Deleted: {project['name']}")
print(f"Total deleted: {deleted}")
Best Practices
Before Deleting
- Export data: Download any project reports before deletion
- Unlink entities first: If you want to preserve the entity-project links for audit, document them before deleting
- Check dependencies: Ensure no active reports or dashboards depend on this project
Related Endpoints
Update Project
Modify project instead of deleting
List Projects
View all projects
Get Project
View project details before deleting
Unlink Entities
Remove entity associations without deleting the project
Was this page helpful?