Skip to content
GET /file/{id}

What is true of one file id for the caller: `pending` (their upload link is waiting for its bytes), `ready` (a file they can open, with the same `can_*` fields a list row carries) or `expired`. The poll for an upload, and the cheap “can I use this id?” check before passing it to a connector tool. `404` is the one answer for an id that is not the caller’s to know about: unknown, someone else’s, another organization’s, or vetoed by a restriction.

Path Parameters

idstring
required·

File id (file_…).

Response Body

accessstring,null
Possible values:
ownerviewnull
can_deleteboolean
can_openboolean
can_revoke_shareboolean
can_see_sharesboolean
can_shareboolean
expires_atstring · date-time
file_idstring
filenamestring
max_bytesinteger,null

The link’s size limit while pending.

mimestring,null
originstring

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.

Possible values:
tooluploadrequestinlineapiurl_importweb_fetchexport
origin_hoststring,null

The web host an import or web fetch read from, or the asking app’s name for origin request; null otherwise.

size_bytesinteger,null
statusstring

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.

Possible values:
pendingreadyexpired
urlstring,null

The console download page, for a ready file.

curl -X GET 'https://api.elaichi.ai/file/<id>' \
  -H 'Authorization: Bearer $ELAICHI_API_TOKEN' \
  -H 'Content-Type: application/json'
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);
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())