# Check a file id

> Source: https://elaichi.ai/docs/api-reference/files/file/getfile/

`GET /file/{id}`

Resource: **File** · API: **Files**

## Path parameters

- **`id`** _(string, required)_
  File id (`file_…`).

## Response body

- **`file_id`** _(string)_
- **`status`** _(string)_
  `pending`: an upload link you made is waiting for its bytes (not a file yet: no type, size or URL). `ready`: a file you can open. `expired`: your link ran out unused, or the file it filled is gone.
  Allowed: `pending`, `ready`, `expired`
- **`filename`** _(string)_
- **`mime`** _(string,null)_
- **`size_bytes`** _(integer,null)_
- **`expires_at`** _(string)_
- **`url`** _(string,null)_
  The console download page, for a `ready` file.
- **`origin`** _(string)_
  How the bytes got here: `tool` (a connector tool returned them), `upload` (a person chose it on the Files screen), `request` (a person handed it to an app that asked, through an upload request; `origin_host` is the app), `inline` (content an assistant wrote with `file.create`), `api` (a backend sent it to `POST /file` with a token), `url_import`, `web_fetch` (fetched from the web), `export` (produced by an export). Provenance for wording (“Uploaded by Dana”), never an access gate.
  Allowed: `tool`, `upload`, `request`, `inline`, `api`, `url_import`, `web_fetch`, `export`
- **`origin_host`** _(string,null)_
  The web host an import or web fetch read from, or the asking app’s name for origin `request`; null otherwise.
- **`max_bytes`** _(integer,null)_
  The link’s size limit while `pending`.
- **`access`** _(string,null)_
  Allowed: `owner`, `view`, `null`
- **`can_open`** _(boolean)_
- **`can_delete`** _(boolean)_
- **`can_share`** _(boolean)_
- **`can_see_shares`** _(boolean)_
- **`can_revoke_share`** _(boolean)_

## Code examples

### curl

```bash
curl -X GET 'https://api.elaichi.ai/file/<id>' \
  -H 'Authorization: Bearer $ELAICHI_API_TOKEN' \
  -H 'Content-Type: application/json'
```

### JavaScript

```javascript
const response = await fetch('https://api.elaichi.ai/file/<id>', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer ' + process.env.ELAICHI_API_TOKEN,
    'Content-Type': 'application/json',
  },
});

const data = await response.json();
console.log(data);
```

### Python

```python
import os
import requests

url = "https://api.elaichi.ai/file/<id>"
headers = {
    "Authorization": f"Bearer {os.environ['ELAICHI_API_TOKEN']}",
    "Content-Type": "application/json",
}

response = requests.get(url, headers=headers)
print(response.json())
```
