Upload file
curl --request POST \
--url https://api.getlemma.com/v0/files \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"entity_id": "<string>",
"purpose": "<string>"
}
'import requests
url = "https://api.getlemma.com/v0/files"
payload = {
"entity_id": "<string>",
"purpose": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({entity_id: '<string>', purpose: '<string>'})
};
fetch('https://api.getlemma.com/v0/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.getlemma.com/v0/files",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'entity_id' => '<string>',
'purpose' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.getlemma.com/v0/files"
payload := strings.NewReader("{\n \"entity_id\": \"<string>\",\n \"purpose\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.getlemma.com/v0/files")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"entity_id\": \"<string>\",\n \"purpose\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getlemma.com/v0/files")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"entity_id\": \"<string>\",\n \"purpose\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "file_Xt7nRv3hBw9pKm4s",
"entity_id": "entity_k7mXp2vR9nTfBw4s",
"purpose": "explanation_of_benefits",
"filename": "eob-march-2026.pdf",
"content_type": "application/pdf",
"created_at": "2026-03-15T14:30:00Z"
}
{
"statusCode": 413,
"error": "Content Too Large",
"message": "File size exceeds the maximum allowed size of 10 MB."
}
{
"statusCode": 422,
"error": "Unprocessable Entity",
"message": "Invalid file type for purpose \"explanation_of_benefits\". Accepted types: application/pdf."
}
Reconciliation
Upload file
Upload a document and receive a file ID for use with other endpoints.
POST
/
v0
/
files
Upload file
curl --request POST \
--url https://api.getlemma.com/v0/files \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"entity_id": "<string>",
"purpose": "<string>"
}
'import requests
url = "https://api.getlemma.com/v0/files"
payload = {
"entity_id": "<string>",
"purpose": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({entity_id: '<string>', purpose: '<string>'})
};
fetch('https://api.getlemma.com/v0/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.getlemma.com/v0/files",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'entity_id' => '<string>',
'purpose' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.getlemma.com/v0/files"
payload := strings.NewReader("{\n \"entity_id\": \"<string>\",\n \"purpose\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.getlemma.com/v0/files")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"entity_id\": \"<string>\",\n \"purpose\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getlemma.com/v0/files")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"entity_id\": \"<string>\",\n \"purpose\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "file_Xt7nRv3hBw9pKm4s",
"entity_id": "entity_k7mXp2vR9nTfBw4s",
"purpose": "explanation_of_benefits",
"filename": "eob-march-2026.pdf",
"content_type": "application/pdf",
"created_at": "2026-03-15T14:30:00Z"
}
{
"statusCode": 413,
"error": "Content Too Large",
"message": "File size exceeds the maximum allowed size of 10 MB."
}
{
"statusCode": 422,
"error": "Unprocessable Entity",
"message": "Invalid file type for purpose \"explanation_of_benefits\". Accepted types: application/pdf."
}
Uploads a file to Lemma and returns a file object. You can reference the returned
id when creating resources that accept a file_id, such as the Upload EOB endpoint.
Send the request as multipart/form-data. The maximum file size is 10 MB. Accepted file types depend on the purpose — see below.
Request body
The file to upload. Maximum size is 10 MB. Accepted MIME types depend on the
purpose field.The ID of the entity this file belongs to.
The intended use of the file. Determines which file types are accepted.
| Purpose | Accepted types |
|---|---|
explanation_of_benefits | PDF (application/pdf) |
Response
Returns the created file object.Unique identifier for the file.
The ID of the entity this file belongs to.
The intended use of the file.
The original name of the uploaded file.
The MIME type of the file.
{
"id": "file_Xt7nRv3hBw9pKm4s",
"entity_id": "entity_k7mXp2vR9nTfBw4s",
"purpose": "explanation_of_benefits",
"filename": "eob-march-2026.pdf",
"content_type": "application/pdf",
"created_at": "2026-03-15T14:30:00Z"
}
{
"statusCode": 413,
"error": "Content Too Large",
"message": "File size exceeds the maximum allowed size of 10 MB."
}
{
"statusCode": 422,
"error": "Unprocessable Entity",
"message": "Invalid file type for purpose \"explanation_of_benefits\". Accepted types: application/pdf."
}
⌘I