Bulk Delete Workforce Trainings
const options = {
method: 'POST',
headers: {
'x-api-key': '<x-api-key>',
'x-organization-id': '<x-organization-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({training_ids: {}, consolidate_group: true})
};
fetch('https://api.dcycle.io/v1/own_workforce_trainings/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/own_workforce_trainings/bulk-delete"
payload = {
"training_ids": {},
"consolidate_group": True
}
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/own_workforce_trainings/bulk-delete \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>' \
--data '
{
"training_ids": {},
"consolidate_group": true
}
'{
"success_count": 123,
"success_ids": {},
"failed_count": 123,
"failed_ids": {},
"message": "<string>"
}Bulk Delete Workforce Trainings
Delete many training records at once by passing their ids
POST
/
v1
/
own_workforce_trainings
/
bulk-delete
Bulk Delete Workforce Trainings
const options = {
method: 'POST',
headers: {
'x-api-key': '<x-api-key>',
'x-organization-id': '<x-organization-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({training_ids: {}, consolidate_group: true})
};
fetch('https://api.dcycle.io/v1/own_workforce_trainings/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/own_workforce_trainings/bulk-delete"
payload = {
"training_ids": {},
"consolidate_group": True
}
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/own_workforce_trainings/bulk-delete \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>' \
--data '
{
"training_ids": {},
"consolidate_group": true
}
'{
"success_count": 123,
"success_ids": {},
"failed_count": 123,
"failed_ids": {},
"message": "<string>"
}← Own Workforce API
Delete up to 100,000 training records in one call. The response reports what succeeded and what did not, so a partial failure is visible rather than silent.
Irreversible: there is no endpoint that recreates a training, only a re-import.
The call returns
Request
Headers
string
required
Your API key for authenticationExample:
sk_live_1234567890abcdefstring
required
Your organization UUIDExample:
a8315ef3-dd50-43f8-b7ce-d839e68d51faBody
array[string]
required
Training UUIDs to delete. Between 1 and 100,000 entries.
boolean
default:"false"
Group view.
false authorizes deletion inside the header organization only; true across the whole accepted family.Ids outside the resolved perimeter are never deleted — they come back in failed_ids.Response
integer
How many records were deleted
array[string]
Ids of the deleted records
integer
How many ids were not deleted — unknown, already gone, or outside your perimeter
array[string]
Ids that were not deleted
string
Human-readable summary
200 OK even when some ids fail. Read failed_count, not the status code.
Example
curl -X POST "https://api.dcycle.io/v1/own_workforce_trainings/bulk-delete" \
-H "x-api-key: ${DCYCLE_API_KEY}" \
-H "x-organization-id: ${DCYCLE_ORG_ID}" \
-H "Content-Type: application/json" \
-d '{"training_ids": ["3d9b0a11-2c4e-4f6a-8b1d-5e7f9a0c2d4e"]}'
import os
import requests
headers = {
"x-api-key": os.getenv("DCYCLE_API_KEY"),
"x-organization-id": os.getenv("DCYCLE_ORG_ID"),
}
response = requests.post(
"https://api.dcycle.io/v1/own_workforce_trainings/bulk-delete",
headers=headers,
json={"training_ids": ["3d9b0a11-2c4e-4f6a-8b1d-5e7f9a0c2d4e"]},
)
result = response.json()
print(f"deleted {result['success_count']}, failed {result['failed_count']}")
const axios = require('axios');
const headers = {
'x-api-key': process.env.DCYCLE_API_KEY,
'x-organization-id': process.env.DCYCLE_ORG_ID
};
axios.post('https://api.dcycle.io/v1/own_workforce_trainings/bulk-delete', {
training_ids: ['3d9b0a11-2c4e-4f6a-8b1d-5e7f9a0c2d4e']
}, { headers })
.then(({ data }) => console.log(`deleted ${data.success_count}, failed ${data.failed_count}`))
.catch(error => console.error(error));
Successful Response
{
"success_count": 1,
"success_ids": ["3d9b0a11-2c4e-4f6a-8b1d-5e7f9a0c2d4e"],
"failed_count": 0,
"failed_ids": [],
"message": "Deleted 1 training record"
}
Common Errors
401 Unauthorized
Cause: the key is invalid, or it does not belong to the organization inx-organization-id — the two are looked up as a pair. A request carrying no credentials at all answers AUTH_REQUIRED instead.
{
"detail": "Invalid API key for organization",
"code": "INVALID_API_KEY"
}
403 Forbidden
Cause: the key’s owner is not an enabled member of the organization, or their role cannot write.{
"detail": "Logged User is not Member of Organization",
"code": "LOGGED_USER_NOT_MEMBER"
}
422 Unprocessable Entity
Cause: emptytraining_ids, more than 100,000 entries, or a value that is not a UUID.
{
"detail": [
{
"type": "too_short",
"loc": ["body", "training_ids"],
"msg": "List should have at least 1 item after validation, not 0"
}
]
}
Related Endpoints
Bulk delete by filters
Delete a filtered set without collecting ids
Delete one training
Single-record deletion
Was this page helpful?