> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.monite.com/v-2024-05-25/api/files/get-files/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.monite.com/_mcp/server. # Get files GET https://api.sandbox.monite.com/v1/files The `/files` endpoint provides access to an entity's files hosted on Monite's servers. This includes both files uploaded by the entity and files that were automatically created by Monite (such as PDF versions of invoices). `GET /files` requires at least one query parameter, either `id__in` or `file_type`. You can use this operation to: * Bulk fetch multiple files by IDs. * Get all files with the given purpose (for example, invoice attachments). If no files matching the query parameters were found, the response contains an empty `data` array. Both partner tokens and entity user tokens can be used for authentication. Reference: https://docs.monite.com/api/files/get-files ## Authentication - `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer `, where token is your auth token. ## Servers - `https://api.sandbox.monite.com/v1` (sandbox, default) - `https://api.monite.com/v1` (eu_production) - `https://us.api.monite.com/v1` (na_production) ## Request ### Query parameters - `id__in` (string, optional) — Return only files with specified IDs. Valid but nonexistent IDs do not raise errors but produce no results. To specify multiple IDs, repeat this parameter for each value: `id__in=&id__in=` - `file_type` (enum, optional) — Return only files with the given purpose. Possible values: * `additional_identity_documents` and `identity_documents` - [entity verification documents](https://docs.monite.com/payments/onboarding/via-api/documents) uploaded for payments onboarding. * `attachments` - supplementary attachments for accounts receivable invoices, quotes, and credit notes. * `delivery_notes` - auto-generated PDF versions of delivery notes. * `einvoices_xml` - e-invoice XML generated when sending e-invoices. * `payables` - payables (bills) received via email or uploaded via API. * `receivable_signatures` - images of customer signatures provided during quote acceptance. * `receivables` - auto-generated PDF versions of invoices, quotes, and credit notes. * `zip` - data export archives created by `POST /data_exports`. Other values are unused. - Allowed values: `ocr_results`, `ocr_files`, `payables`, `receivables`, `delivery_notes`, `receipts`, `userpics`, `entity_logo`, `companies_logo`, `zip`, `identity_documents`, `additional_identity_documents`, `receivable_signatures`, `einvoices_xml`, `attachments` ### Headers - `x-monite-version` (string, required) ## Response ### 200 Successful Response - `data` (list of FileResponse, required) ## Errors ### 401 Get Files Request Unauthorized Error The `Authorization` header is missing or contains an invalid or expired access token. See [Authentication](https://docs.monite.com/api/concepts/authentication) to learn how to authenticate API calls. - `any` ### 422 Get Files Request Unprocessable Entity Error Validation Error - `detail` (list of ValidationError, optional) ### 429 Get Files Request Too Many Requests Error API rate limit has been exceeded. Check the response headers for the rate limit information. - `any` ## Types ### FileResponse - `id` (string, required) — A unique ID assigned to this file. - `created_at` (datetime, required) — Date and time when this file was uploaded to or created in Monite. Timestamps follow the ISO 8601 format. - `updated_at` (datetime, required) — Date and time when this file was last updated in Monite. Timestamps follow the ISO 8601 format. - `file_type` (string, required) — Possible values: * `additional_identity_documents` and `identity_documents` - [entity verification documents](https://docs.monite.com/payments/onboarding/via-api/documents) uploaded for payments onboarding. * `attachments` - supplementary attachments for accounts receivable invoices, quotes, and credit notes. * `delivery_notes` - auto-generated PDF versions of delivery notes. * `einvoices_xml` - e-invoice XML generated when sending e-invoices. * `payables` - payables (bills) received via email or uploaded via API. * `receivable_signatures` - images of customer signatures provided during quote acceptance. * `receivables` - auto-generated PDF versions of invoices, quotes, and credit notes. * `zip` - data export archives created by `POST /data_exports`. - `md5` (string, required) — The MD5 hash of the file. - `mimetype` (string, required) — The file's media type, for example, `application/pdf` or `image/png`. - `name` (string, required) — The original file name (if available). - `region` (string, required) — Geographical region of the data center where the file is stored. - `s3_bucket` (string, required) — Unused. - `s3_file_path` (string, required) — Unused. - `size` (integer, required) — The file size in bytes. - `url` (string, required) — The URL to download the file. ### ValidationError - `loc` (list of ValidationErrorLocItem, required) - `msg` (string, required) - `type` (string, required) ### ValidationErrorLocItem ## Examples **Response** ```json { "data": [ { "id": "id", "created_at": "2024-01-15T09:30:00Z", "updated_at": "2024-01-15T09:30:00Z", "file_type": "file_type", "md5": "60997cbcc1a6fb2ec37d389ffa8588db", "mimetype": "application/pdf", "name": "timesheet.pdf", "region": "eu-central-1", "s3_bucket": "s3_bucket", "s3_file_path": "s3_file_path", "size": 120101, "url": "https://bucketname.s3.amazonaws.com/path/to/timesheet.pdf" } ] } ``` **SDK Code** ```python import requests url = "https://api.sandbox.monite.com/v1/files" headers = { "x-monite-version": "2024-05-25", "Authorization": "Bearer " } response = requests.get(url, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.sandbox.monite.com/v1/files'; const options = { method: 'GET', headers: {'x-monite-version': '2024-05-25', Authorization: 'Bearer '} }; 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.sandbox.monite.com/v1/files" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("x-monite-version", "2024-05-25") req.Header.Add("Authorization", "Bearer ") 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.sandbox.monite.com/v1/files") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["x-monite-version"] = '2024-05-25' request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api.sandbox.monite.com/v1/files") .header("x-monite-version", "2024-05-25") .header("Authorization", "Bearer ") .asString(); ``` ```php request('GET', 'https://api.sandbox.monite.com/v1/files', [ 'headers' => [ 'Authorization' => 'Bearer ', 'x-monite-version' => '2024-05-25', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.sandbox.monite.com/v1/files"); var request = new RestRequest(Method.GET); request.AddHeader("x-monite-version", "2024-05-25"); request.AddHeader("Authorization", "Bearer "); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "x-monite-version": "2024-05-25", "Authorization": "Bearer " ] let request = NSMutableURLRequest(url: NSURL(string: "https://api.sandbox.monite.com/v1/files")! 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() ```