## Delete a file

`client.files.delete(stringfileID, FileDeleteParamsparams?, RequestOptionsoptions?): FileDeleteResponse`

**delete** `/v5/files/{file_id}`

Delete a file by id, removing its database record.

This is a hard delete: the file's row is removed from the database, not
soft-archived. The underlying stored object is deleted only when no other
file record still references the same stored content (identical checksum and
MIME type); when another record shares the blob, the blob is retained. If the
id refers to an incomplete multipart upload placeholder, its staged parts are
aborted instead. Returns a confirmation carrying the deleted file's id.

### Parameters

- `fileID: string`

- `params: FileDeleteParams`

  - `xProjectID?: string`

### Returns

- `FileDeleteResponse`

  - `id: string`

  - `deleted: boolean`

  - `object?: "file"`

    - `"file"`

### Example

```typescript
import SGPClient from 'scale-gp';

const client = new SGPClient({
  accountID: 'My Account ID',
  apiKey: process.env['SGP_API_KEY'], // This is the default and can be omitted
});

const file = await client.files.delete('file_id');

console.log(file.id);
```

#### Response

```json
{
  "id": "id",
  "deleted": true,
  "object": "file"
}
```
