Delete a cost centre
const url = 'https://api2.recruso.co.uk/v1/branches/1/cost-centres/1';const options = { method: 'DELETE', headers: {Authorization: '<Authorization>', 'Content-Type': '*/*'}, body: '{ "branchId": 4, "id": 31 }'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request DELETE \ --url https://api2.recruso.co.uk/v1/branches/1/cost-centres/1 \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: */*' \ --data '{ "branchId": 4, "id": 31 }'Soft-deletes a cost centre. The record is retained so historical data that references it stays intact; it stops appearing in ListCostCentres and GetCostCentreById.
The name stays reserved within the branch, so creating a cost centre with the same name afterwards returns 409 rather than succeeding. RestoreCostCentre reverses this.
A cost centre outside your agency, already deleted, under a different branch, or under a branch you cannot access returns 404.
Access. Requires a client-credentials access token. Tokens issued through the interactive user login are rejected.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The branchId path parameter
The id path parameter
Request Bodyrequired
Section titled “Request Bodyrequired”Identifies the cost centre to delete. Both values are bound from the route; the endpoint takes no request body.
object
The branch the cost centre belongs to.
Example
4The cost centre to soft-delete.
Example
31Identifies the cost centre to delete. Both values are bound from the route; the endpoint takes no request body.
object
The branch the cost centre belongs to.
Example
4The cost centre to soft-delete.
Example
31Responses
Section titled “Responses”No Content
Unauthorized
object
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}Forbidden
object
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}Not Found
object
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}
