## Get file metadata

`client.files.retrieve(stringfileID, FileRetrieveParamsparams?, RequestOptionsoptions?): SGPFile`

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

Retrieve a single file's metadata by id.

Returns the file record (id, filename, MIME type, size, tags, and related
fields) but not the file's bytes; use the content endpoint to download the
bytes.

### Parameters

- `fileID: string`

- `params: FileRetrieveParams`

  - `xProjectID?: string`

### Returns

- `SGPFile`

  - `id: string`

    The unique identifier of the entity.

  - `created_at: string`

    The date and time when the entity was created in ISO format.

  - `created_by: Identity`

    The identity that created the entity.

    - `id: string`

    - `type: "user" | "service_account"`

      - `"user"`

      - `"service_account"`

    - `object?: "identity"`

      - `"identity"`

  - `filename: string`

  - `md5_checksum: string`

  - `mime_type: string`

  - `size: number`

  - `duration_seconds?: number`

  - `object?: "file"`

    - `"file"`

  - `tags?: Record<string, unknown>`

### 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 sgpFile = await client.files.retrieve('file_id');

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

#### Response

```json
{
  "id": "id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "created_by": {
    "id": "id",
    "type": "user",
    "object": "identity"
  },
  "filename": "filename",
  "md5_checksum": "md5_checksum",
  "mime_type": "mime_type",
  "size": 0,
  "duration_seconds": 0,
  "object": "file",
  "tags": {
    "foo": "bar"
  }
}
```
