> ## Documentation Index
> Fetch the complete documentation index at: https://stashfyle.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Get File

> Get metadata for a specific file.

Retrieve metadata for a specific file by its ID.

## Path Parameters

<ParamField path="id" type="string" required>
  The file ID. Example: `f_abc123xyz`
</ParamField>

## Response

<ResponseField name="id" type="string" required>
  Unique file identifier.
</ResponseField>

<ResponseField name="url" type="string">
  Public URL (null for private files).
</ResponseField>

<ResponseField name="name" type="string" required>
  Original filename.
</ResponseField>

<ResponseField name="folder" type="string">
  Folder path, or null if at root.
</ResponseField>

<ResponseField name="size" type="integer" required>
  File size in bytes.
</ResponseField>

<ResponseField name="type" type="string" required>
  MIME type.
</ResponseField>

<ResponseField name="private" type="boolean" required>
  Whether file requires signed URL.
</ResponseField>

<ResponseField name="expires_at" type="string">
  Auto-delete timestamp, or null.
</ResponseField>

<ResponseField name="created_at" type="string" required>
  Upload timestamp.
</ResponseField>

## Example

<CodeGroup>
  ```bash curl theme={null}
  curl https://api.stashfyle.com/v1/files/f_abc123xyz \
    -H "Authorization: Bearer sk_live_xxx"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.stashfyle.com/v1/files/f_abc123xyz', {
    headers: { 'Authorization': 'Bearer sk_live_xxx' }
  });

  const file = await response.json();
  ```

  ```python Python theme={null}
  response = requests.get(
      'https://api.stashfyle.com/v1/files/f_abc123xyz',
      headers={'Authorization': 'Bearer sk_live_xxx'}
  )

  file = response.json()
  ```
</CodeGroup>

```json Response theme={null}
{
  "id": "f_abc123xyz",
  "url": "https://cdn.stashfyle.com/live/user_123/f_abc123xyz/photo.jpg",
  "name": "photo.jpg",
  "folder": null,
  "size": 248000,
  "type": "image/jpeg",
  "private": false,
  "expires_at": null,
  "created_at": "2024-01-15T10:30:00Z"
}
```

## Errors

| Code           | Status | Description                |
| -------------- | ------ | -------------------------- |
| `unauthorized` | 401    | Invalid or missing API key |
| `not_found`    | 404    | File not found or deleted  |
