# Delete a factory. Refused if any machines are still assigned to it. (/docs/api-reference/organizations/OrganizationsController_removeFactory)

`DELETE /api/organizations/{orgId}/factories/{factoryRecordId}`

Base URL: https://api.xentr.ai

Authentication: bearer token (`Authorization: Bearer <token>`).

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `orgId` | path | yes | string | Organization ID |
| `factoryRecordId` | path | yes | string | Factory UUID (not the factory slug) |

## Responses

### 200: Factory deleted

### 404: Factory not found

### 409: Factory has assigned machines