## Delete a file

`client.Files.Delete(ctx, fileID, body) (*FileDeleteResponse, error)`

**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`

- `body FileDeleteParams`

  - `XProjectID param.Field[string]`

### Returns

- `type FileDeleteResponse struct{…}`

  - `ID string`

  - `Deleted bool`

  - `Object FileDeleteResponseObject`

    - `const FileDeleteResponseObjectFile FileDeleteResponseObject = "file"`

### Example

```go
package main

import (
  "context"
  "fmt"

  "github.com/scaleapi/sgp-dev-go"
  "github.com/scaleapi/sgp-dev-go/option"
)

func main() {
  client := sgpdev.NewClient(
    option.WithAPIKey("My API Key"),
    option.WithAccountID("My Account ID"),
  )
  file, err := client.Files.Delete(
    context.TODO(),
    "file_id",
    sgpdev.FileDeleteParams{

    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", file.ID)
}
```

#### Response

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