curl --request POST \
--url https://api.example.com/v1/prior-authorizations/{id}/documents \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"source_file_id": "<string>"
}
'import requests
url = "https://api.example.com/v1/prior-authorizations/{id}/documents"
payload = { "source_file_id": "<string>" }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({source_file_id: '<string>'})
};
fetch('https://api.example.com/v1/prior-authorizations/{id}/documents', 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.example.com/v1/prior-authorizations/{id}/documents",
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([
'source_file_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.example.com/v1/prior-authorizations/{id}/documents"
payload := strings.NewReader("{\n \"source_file_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.example.com/v1/prior-authorizations/{id}/documents")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"source_file_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/prior-authorizations/{id}/documents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"source_file_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"name": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"display_name": "<string>",
"url": "<string>",
"mime_type": "<string>",
"size": 123,
"uploaded_by": "<string>",
"type": "fax",
"patient_id": "<string>",
"form_submission_id": "<string>",
"message_id": "<string>",
"prior_authorization_id": "<string>",
"patient": {},
"document_type": "referral",
"page_count": 123,
"metadata": {}
}{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"meta": {}
}{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"meta": {}
}{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"meta": {}
}{
"type": "validation_error",
"code": "invalid_parameter",
"message": "Field validation failed",
"param": "phone_number"
}Attach a patient document to a prior authorization
Attach an existing patient document to this prior authorization. A document not attached to any prior authorization is linked directly; a document that already belongs to another prior authorization is attached as an independent copy, leaving the original request’s record untouched. Returns the attached file.
curl --request POST \
--url https://api.example.com/v1/prior-authorizations/{id}/documents \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"source_file_id": "<string>"
}
'import requests
url = "https://api.example.com/v1/prior-authorizations/{id}/documents"
payload = { "source_file_id": "<string>" }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({source_file_id: '<string>'})
};
fetch('https://api.example.com/v1/prior-authorizations/{id}/documents', 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.example.com/v1/prior-authorizations/{id}/documents",
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([
'source_file_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.example.com/v1/prior-authorizations/{id}/documents"
payload := strings.NewReader("{\n \"source_file_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.example.com/v1/prior-authorizations/{id}/documents")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"source_file_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/prior-authorizations/{id}/documents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"source_file_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"name": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"display_name": "<string>",
"url": "<string>",
"mime_type": "<string>",
"size": 123,
"uploaded_by": "<string>",
"type": "fax",
"patient_id": "<string>",
"form_submission_id": "<string>",
"message_id": "<string>",
"prior_authorization_id": "<string>",
"patient": {},
"document_type": "referral",
"page_count": 123,
"metadata": {}
}{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"meta": {}
}{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"meta": {}
}{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"meta": {}
}{
"type": "validation_error",
"code": "invalid_parameter",
"message": "Field validation failed",
"param": "phone_number"
}Authorizations
Path Parameters
Body
Body for POST /prior-authorizations/{id}/documents.
Id of the patient document to attach to this prior authorization.
Response
Successful Response
File resource.
Extends BaseResource to include file-specific fields. All fields use snake_case.
User-friendly display name for the file
File URL (may require authentication)
MIME type of the file
File category: fax, prior_auth, patient_document, form_upload
fax, prior_auth, patient_document, form_upload AI classification of any uploaded file, not just faxes.
Lives on files.document_type and drives fax stage routing. Bound to PG
enum document_type.
referral, authorization, intake_documents, legal_documents, financial_documents, insurance_card, billing, spam, plan_of_care, diagnosis, medical_records, other 
