> This documentation belongs to Invofox, an AI-powered document processing
> platform. The API extracts structured data (fields) from unstructured
> documents (invoices, contracts, forms, bank statements, and more).
> Key concepts: Account, Environment, Document Type, Field, File, Import,
> and Document. When answering, prefer the exact terminology defined in the
> Glossary and cite the relevant API Reference endpoint when applicable.

# Get file information by ID

GET https://api.invofox.com/v1/ingest/files/{fileId}

Retrieves file information if the user belongs to the same environment

Reference: https://developers.invofox.com/api-reference/ingest-reference/files/files-controller-get-file

## Authentication

- `x-api-key` header (required) — API key authentication for programmatic access. Used by server-to-server integrations and API clients.
- `x-access-token` header (required) — Access token authentication for web users. Used by browser-based applications and authenticated user sessions.

## Request

### Path parameters

- `fileId` (string, required) — The ID of the file

## Response

### 200

File information retrieved successfully

- `id` (string, required) — Unique identifier of the file
- `accountId` (string, required) — Account identifier
- `environmentId` (string, required) — Environment identifier
- `importId` (string, required) — Import identifier
- `filename` (string, required) — Name of the file
- `compressed` (boolean, required) — Indicates if the file is compressed
- `status` (enum, required) — Current processing status of the file
  - Allowed values: `pending`, `processing`, `processed`, `rejected`
- `mimeType` (string, required) — MIME type of the file
- `companyId` (string, optional) — Company identifier
- `parentFileId` (string, optional) — Parent file identifier if this file was extracted from another
- `documentIds` (list of string, optional) — Array of document identifiers extracted from this file
- `error` (string, optional) — Error code if processing failed
- `createdAt` (string, optional) — Timestamp when the file was created
- `updatedAt` (string, optional) — Timestamp when the file was last updated
- `clientData` (FileResponseDtoClientData, optional) — Client data associated to the file

## Errors

### 404 Not Found Error

File not found

- `any`

## Types

### FileResponseDtoClientData

Client data associated to the file

## Examples

**Response**

```json
{
  "id": "000000000000000000000011",
  "accountId": "00000000000000000000000f",
  "environmentId": "000000000000000000000010",
  "importId": "00000000000000000000000c",
  "filename": "invoice.pdf",
  "compressed": false,
  "status": "processed",
  "mimeType": "application/pdf",
  "companyId": "000000000000000000000007",
  "parentFileId": "000000000000000000000011",
  "documentIds": [
    "00000000000000000000000d",
    "00000000000000000000000e"
  ],
  "error": "ERR_UNSUPPORTED_FILE_FORMAT",
  "createdAt": "2024-09-26T10:30:00.000Z",
  "updatedAt": "2024-09-26T10:35:00.000Z",
  "clientData": {
    "invofoxAccountName": "company-name",
    "invofoxCompanyId": "12345",
    "userId": "507f1f77bcf86cd799439015"
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.invofox.com/v1/ingest/files/000000000000000000000011"

headers = {"x-api-key": "<apiKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.invofox.com/v1/ingest/files/000000000000000000000011';
const options = {method: 'GET', headers: {'x-api-key': '<apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.invofox.com/v1/ingest/files/000000000000000000000011"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-api-key", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.invofox.com/v1/ingest/files/000000000000000000000011")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.invofox.com/v1/ingest/files/000000000000000000000011")
  .header("x-api-key", "<apiKey>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.invofox.com/v1/ingest/files/000000000000000000000011', [
  'headers' => [
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.invofox.com/v1/ingest/files/000000000000000000000011");
var request = new RestRequest(Method.GET);
request.AddHeader("x-api-key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["x-api-key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.invofox.com/v1/ingest/files/000000000000000000000011")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```