## Delete a company by external company ID **delete** `/v2/companies/by-company-id/{companyId}` Permanently deletes a company by its external company ID (the `companyId` from your system). This will also remove the company from all linked users' associations. ### Path Parameters - `companyId` - The external company ID from your system ### Deletion Behavior When a company is deleted: - The company record is permanently removed - The company is removed from all linked users' `companyIds` and `companies` arrays ### Response Returns a deletion confirmation object: - `id` - The Featurebase internal ID of the deleted company - `object` - Always "company" - `deleted` - Always `true` ### Example Response ```json { "id": "507f1f77bcf86cd799439011", "object": "company", "deleted": true } ``` ### Use Case Use this endpoint when you need to delete a company using your own system's company identifier, such as when a company is removed from your application. ### Version Availability This endpoint is only available in API version 2026-01-01.nova and newer. ### Path Parameters - `companyId: string` The external company ID from your system ### Header Parameters - `"Featurebase-Version": optional "2026-01-01.nova" or "2025-12-12.clover"` - `"2026-01-01.nova"` - `"2025-12-12.clover"` ### Returns - `DeletedCompany object { id, deleted, object }` - `id: string` Unique identifier of the deleted company - `deleted: true` Indicates the resource was deleted - `true` - `object: "company"` Object type identifier - `"company"` ### Example ```http curl https://do.featurebase.app/v2/companies/by-company-id/$COMPANY_ID \ -X DELETE \ -H "Authorization: Bearer $FEATUREBASE_API_KEY" ``` #### Response ```json { "id": "507f1f77bcf86cd799439011", "deleted": true, "object": "company" } ```