> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bbrands.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete Company

Soft-deletes a company record by setting the `deleted_at` timestamp and `is_deleted` flag. The record remains in the database but is marked as deleted for data retention. Allows for potential recovery while marking the record as deleted.

## Endpoint

```
DELETE /api/v3/product/company/{documentId}
```

## Authentication

This endpoint requires authentication. Include a valid bearer token in the Authorization header.

**Permission Required**: `company:delete`

## Path Parameters

<ParamField name={'documentId'} required={true} type={'uuid'} visibility={'public'}>
  The unique document identifier of the company record to soft-delete. Must be a valid UUID format.
</ParamField>

## Response

### Success Response (200 OK)

Returns an empty data object indicating successful deletion.

```json theme={null}
{
  "message": "Company record deleted successfully",
  "data": {},
  "meta": {
    "correlation": "29146752-ef3a-4569-b397-ff2144412c4a",
    "status": 200,
    "timestamp": "2024-01-01T00:00:00.000Z"
  }
}
```

### Error Responses

**401 Unauthorized** - Missing or invalid authentication token

**403 Forbidden** - Insufficient permissions

**404 Not Found** - Record not found, inactive, or already deleted

```json theme={null}
{
  "error": {
    "code": "NOT_FOUND",
    "message": "Record with document_id '550e8400-e29b-41d4-a716-446655440000' not found"
  },
  "meta": {
    "correlation": "...",
    "status": 404,
    "timestamp": "..."
  }
}
```

## Notes

* This is a **soft delete** operation. The record is not permanently removed from the database.
* The record is marked as deleted by setting `deleted_at` timestamp and `is_deleted = true`.
* Soft-deleted records are excluded from normal queries (findAll, findOne).
* To permanently delete a record, use the `/api/v3/product/company/{documentId}/purge` endpoint.
* Only active records (`is_actived = true`) that are not already deleted (`is_deleted = false`) can be soft-deleted.

## Examples

### Basic Request

```bash theme={null}
curl -X DELETE 'https://api.bbrands.io/api/v3/product/company/550e8400-e29b-41d4-a716-446655440000' \
  -H 'Authorization: Bearer YOUR_TOKEN'
```
