Skip to main content
DELETE
/
companies
/
{id}
Delete Company
curl --request DELETE \
  --url https://api.example.com/companies/{id}
{
  "success": true,
  "message": "<string>"
}
Delete a company by ID. By default, performs a soft delete. Use the hard_delete query parameter for permanent deletion.

Path Parameters

id
string
required
Company UUID

Query Parameters

hard_delete
boolean
default:"false"
When set to true, permanently deletes the company. Otherwise, performs a soft delete (marks as deleted but retains data).

Response

success
boolean
Indicates if the request was successful
message
string
Confirmation message

Request Examples

cURL
curl -X DELETE https://api.companyflow.com/companies/123e4567-e89b-12d3-a456-426614174000 \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

Response Example

200 OK
{
  "success": true,
  "message": "company deleted"
}
400 Bad Request
{
  "success": false,
  "message": "invalid company id"
}
500 Internal Server Error
{
  "success": false,
  "message": "internal server error"
}

Error Responses

Status CodeDescription
400Invalid company ID format (must be valid UUID)
500Internal server error

Important Notes

  • Soft Delete (default): The company is marked as deleted but data is retained in the database. This allows for potential recovery and maintains referential integrity.
  • Hard Delete: The company record is permanently removed from the database. This action cannot be undone.
  • Deleting a company may affect related resources such as users, projects, and other associated data. Ensure you understand the implications before performing a hard delete.

Build docs developers (and LLMs) love