Delete department

DELETE /api/configuration/departments/{id}

Overview

Removes a department — the financial grouping that products and activities are booked against, and which links them to a cost centre.

This is a hard delete with no dependency check of its own. The department is looked up and removed; there is no soft-delete flag, no archive and no "in use" test before the delete is attempted. Nothing is returned that you could use to reverse it, so re-creating the department means creating a new one with the same identifier.

A department that is still referenced fails as a 500, not a 409. The only thing preventing the delete is that other records — products among them — still carry the department id, and that failure is reported as a generic 500 with an empty body. Nothing is deleted when this happens, but the status code will not tell you that a dependency was the reason. Check what still points at the department before you call, because the endpoint will not tell you.

A repeat call is not a no-op: it answers 404. On a retry that is confirmation the first attempt succeeded.

On success, a subsequent read reflects the deletion straight away.

Endpoint

DELETE {base_url}/api/configuration/departments/{id}

{base_url} is the environment URL issued to your integration. See Authenticating with Gladstone APIs.

Path parameters

NameTypeRequiredDescription
idstringYesThe department code, as returned by the retrieve-departments endpoints — a string of up to 15 characters, not a number. Departments the platform generated carry a DEPT prefix; ones created with an explicit identifier keep whatever you gave them. The lookup is an exact match with no trimming, so a stray space or the wrong case returns 404.

Sample request

cURL
curl -X DELETE '{base_url}/api/configuration/departments/{id}' \
  -H 'Authorization: Bearer {accessToken}' \
  -H 'X-Use-SSO: true'

Errors

StatusMeaningWhen
404Not foundNo department has that identifier — it never existed, the case or spacing does not match, or a previous call already deleted it. The body is empty.
500Internal server errorThe delete failed. In practice the usual cause is that something still references the department, which blocks the removal; the failure is reported without detail. Nothing is deleted. The body is empty.

This page as markdown · All pages · llms.txt