List files
curl --request GET \
--url https://api-eu.flexportal.io/v1/files \
--header 'Authorization: Bearer <token>' \
--header 'Tenant-ID: <tenant-id>'import requests
url = "https://api-eu.flexportal.io/v1/files"
headers = {
"Tenant-ID": "<tenant-id>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Tenant-ID': '<tenant-id>', Authorization: 'Bearer <token>'}
};
fetch('https://api-eu.flexportal.io/v1/files', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-eu.flexportal.io/v1/files",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Tenant-ID: <tenant-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-eu.flexportal.io/v1/files"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Tenant-ID", "<tenant-id>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-eu.flexportal.io/v1/files")
.header("Tenant-ID", "<tenant-id>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-eu.flexportal.io/v1/files")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Tenant-ID"] = '<tenant-id>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"files": [
{
"fileId": "<string>",
"tenantId": "<string>",
"orderId": "<string>",
"type": "<string>",
"category": "generated",
"filename": "<string>",
"contentType": "<string>",
"fileSize": 123,
"storagePath": "<string>",
"uploadedBy": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"originalFilename": "<string>",
"metadata": {}
}
],
"count": 123,
"limit": 123,
"offset": 123,
"filters": {
"orderId": "<string>",
"type": "<string>"
}
}Files
List Files
Returns a list of files with optional filtering by order or type.
GET
/
v1
/
files
List files
curl --request GET \
--url https://api-eu.flexportal.io/v1/files \
--header 'Authorization: Bearer <token>' \
--header 'Tenant-ID: <tenant-id>'import requests
url = "https://api-eu.flexportal.io/v1/files"
headers = {
"Tenant-ID": "<tenant-id>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Tenant-ID': '<tenant-id>', Authorization: 'Bearer <token>'}
};
fetch('https://api-eu.flexportal.io/v1/files', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-eu.flexportal.io/v1/files",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Tenant-ID: <tenant-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-eu.flexportal.io/v1/files"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Tenant-ID", "<tenant-id>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-eu.flexportal.io/v1/files")
.header("Tenant-ID", "<tenant-id>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-eu.flexportal.io/v1/files")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Tenant-ID"] = '<tenant-id>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"files": [
{
"fileId": "<string>",
"tenantId": "<string>",
"orderId": "<string>",
"type": "<string>",
"category": "generated",
"filename": "<string>",
"contentType": "<string>",
"fileSize": 123,
"storagePath": "<string>",
"uploadedBy": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"originalFilename": "<string>",
"metadata": {}
}
],
"count": 123,
"limit": 123,
"offset": 123,
"filters": {
"orderId": "<string>",
"type": "<string>"
}
}Overview
Retrieve a list of files associated with orders, subscriptions, or your tenant. Files include contracts, invoices, uploaded documents, and other attachments.File Types
| Type | Description |
|---|---|
contract | Subscription contract documents |
invoice | Billing invoices |
document | General uploaded documents |
attachment | Order or subscription attachments |
Common Use Cases
Order Documents
Retrieve contracts and documents for an order
Customer Portal
Display documents for customer self-service
Invoice History
List invoices for a customer or subscription
Document Management
Manage uploaded documents and attachments
Filtering Files
# Get files for an order
GET /v1/files?orderId=ord_abc123
# Get files by type
GET /v1/files?type=contract
# Get invoices for a customer
GET /v1/files?customerId=cust_abc123&type=invoice
Response Fields
| Field | Description |
|---|---|
fileId | Unique file identifier |
fileName | Original file name |
fileType | Type: contract, invoice, document, attachment |
mimeType | MIME type (e.g., application/pdf) |
size | File size in bytes |
orderId | Associated order (if applicable) |
customerId | Associated customer |
createdAt | Upload timestamp |
Example: Get Order Documents
async function getOrderDocuments(orderId) {
const { files } = await listFiles({ orderId });
return files.map(file => ({
name: file.fileName,
type: file.fileType,
size: `${(file.size / 1024).toFixed(1)} KB`
}));
}
Related Endpoints
- Get File - Get file metadata
- Get File URL - Get download URL
- Generate Contract - Create contract document
Authorizations
API key obtained from FlexPortal dashboard
Headers
Your tenant identifier
Query Parameters
Filter by order ID
Filter by file type
Items per page (default: 50)
Was this page helpful?