Create Patient Letter
Create a patient letter. Set is_patient_initiated=true when patient is the author (requires active ChartAccessGrant). Sign separately, then PATCH send_out=true to send.
curl --request POST \
--url https://sandbox.elationemr.com/api/2.0/patient_letters/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"patient": 123,
"practice": 123,
"attachments": [
{
"entity_date": "2023-11-07T05:31:56Z",
"entity_description": "<string>",
"entity_id": 123,
"handout": 123,
"summary": "<string>"
}
],
"body": "<string>",
"delivery_date": "2023-11-07T05:31:56Z",
"document_date": "2023-11-07T05:31:56Z",
"files": [
{
"base64_content": "<string>",
"content_type": "<string>",
"document": "<string>",
"external_content": "<unknown>",
"original_filename": "<string>"
}
],
"is_patient_initiated": true,
"patient_read_time": "2023-11-07T05:31:56Z",
"send_out": true,
"sign_date": "2023-11-07T05:31:56Z",
"signed_by": 123,
"subject": "<string>",
"tags": [
123
],
"viewed_at": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://sandbox.elationemr.com/api/2.0/patient_letters/"
payload = {
"patient": 123,
"practice": 123,
"attachments": [
{
"entity_date": "2023-11-07T05:31:56Z",
"entity_description": "<string>",
"entity_id": 123,
"handout": 123,
"summary": "<string>"
}
],
"body": "<string>",
"delivery_date": "2023-11-07T05:31:56Z",
"document_date": "2023-11-07T05:31:56Z",
"files": [
{
"base64_content": "<string>",
"content_type": "<string>",
"document": "<string>",
"external_content": "<unknown>",
"original_filename": "<string>"
}
],
"is_patient_initiated": True,
"patient_read_time": "2023-11-07T05:31:56Z",
"send_out": True,
"sign_date": "2023-11-07T05:31:56Z",
"signed_by": 123,
"subject": "<string>",
"tags": [123],
"viewed_at": "2023-11-07T05:31:56Z"
}
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({
patient: 123,
practice: 123,
attachments: [
{
entity_date: '2023-11-07T05:31:56Z',
entity_description: '<string>',
entity_id: 123,
handout: 123,
summary: '<string>'
}
],
body: JSON.stringify('<string>'),
delivery_date: '2023-11-07T05:31:56Z',
document_date: '2023-11-07T05:31:56Z',
files: [
{
base64_content: '<string>',
content_type: '<string>',
document: '<string>',
external_content: '<unknown>',
original_filename: '<string>'
}
],
is_patient_initiated: true,
patient_read_time: '2023-11-07T05:31:56Z',
send_out: true,
sign_date: '2023-11-07T05:31:56Z',
signed_by: 123,
subject: '<string>',
tags: [123],
viewed_at: '2023-11-07T05:31:56Z'
})
};
fetch('https://sandbox.elationemr.com/api/2.0/patient_letters/', 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://sandbox.elationemr.com/api/2.0/patient_letters/",
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([
'patient' => 123,
'practice' => 123,
'attachments' => [
[
'entity_date' => '2023-11-07T05:31:56Z',
'entity_description' => '<string>',
'entity_id' => 123,
'handout' => 123,
'summary' => '<string>'
]
],
'body' => '<string>',
'delivery_date' => '2023-11-07T05:31:56Z',
'document_date' => '2023-11-07T05:31:56Z',
'files' => [
[
'base64_content' => '<string>',
'content_type' => '<string>',
'document' => '<string>',
'external_content' => '<unknown>',
'original_filename' => '<string>'
]
],
'is_patient_initiated' => true,
'patient_read_time' => '2023-11-07T05:31:56Z',
'send_out' => true,
'sign_date' => '2023-11-07T05:31:56Z',
'signed_by' => 123,
'subject' => '<string>',
'tags' => [
123
],
'viewed_at' => '2023-11-07T05:31:56Z'
]),
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://sandbox.elationemr.com/api/2.0/patient_letters/"
payload := strings.NewReader("{\n \"patient\": 123,\n \"practice\": 123,\n \"attachments\": [\n {\n \"entity_date\": \"2023-11-07T05:31:56Z\",\n \"entity_description\": \"<string>\",\n \"entity_id\": 123,\n \"handout\": 123,\n \"summary\": \"<string>\"\n }\n ],\n \"body\": \"<string>\",\n \"delivery_date\": \"2023-11-07T05:31:56Z\",\n \"document_date\": \"2023-11-07T05:31:56Z\",\n \"files\": [\n {\n \"base64_content\": \"<string>\",\n \"content_type\": \"<string>\",\n \"document\": \"<string>\",\n \"external_content\": \"<unknown>\",\n \"original_filename\": \"<string>\"\n }\n ],\n \"is_patient_initiated\": true,\n \"patient_read_time\": \"2023-11-07T05:31:56Z\",\n \"send_out\": true,\n \"sign_date\": \"2023-11-07T05:31:56Z\",\n \"signed_by\": 123,\n \"subject\": \"<string>\",\n \"tags\": [\n 123\n ],\n \"viewed_at\": \"2023-11-07T05:31:56Z\"\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://sandbox.elationemr.com/api/2.0/patient_letters/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"patient\": 123,\n \"practice\": 123,\n \"attachments\": [\n {\n \"entity_date\": \"2023-11-07T05:31:56Z\",\n \"entity_description\": \"<string>\",\n \"entity_id\": 123,\n \"handout\": 123,\n \"summary\": \"<string>\"\n }\n ],\n \"body\": \"<string>\",\n \"delivery_date\": \"2023-11-07T05:31:56Z\",\n \"document_date\": \"2023-11-07T05:31:56Z\",\n \"files\": [\n {\n \"base64_content\": \"<string>\",\n \"content_type\": \"<string>\",\n \"document\": \"<string>\",\n \"external_content\": \"<unknown>\",\n \"original_filename\": \"<string>\"\n }\n ],\n \"is_patient_initiated\": true,\n \"patient_read_time\": \"2023-11-07T05:31:56Z\",\n \"send_out\": true,\n \"sign_date\": \"2023-11-07T05:31:56Z\",\n \"signed_by\": 123,\n \"subject\": \"<string>\",\n \"tags\": [\n 123\n ],\n \"viewed_at\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.elationemr.com/api/2.0/patient_letters/")
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 \"patient\": 123,\n \"practice\": 123,\n \"attachments\": [\n {\n \"entity_date\": \"2023-11-07T05:31:56Z\",\n \"entity_description\": \"<string>\",\n \"entity_id\": 123,\n \"handout\": 123,\n \"summary\": \"<string>\"\n }\n ],\n \"body\": \"<string>\",\n \"delivery_date\": \"2023-11-07T05:31:56Z\",\n \"document_date\": \"2023-11-07T05:31:56Z\",\n \"files\": [\n {\n \"base64_content\": \"<string>\",\n \"content_type\": \"<string>\",\n \"document\": \"<string>\",\n \"external_content\": \"<unknown>\",\n \"original_filename\": \"<string>\"\n }\n ],\n \"is_patient_initiated\": true,\n \"patient_read_time\": \"2023-11-07T05:31:56Z\",\n \"send_out\": true,\n \"sign_date\": \"2023-11-07T05:31:56Z\",\n \"signed_by\": 123,\n \"subject\": \"<string>\",\n \"tags\": [\n 123\n ],\n \"viewed_at\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"patient": 123,
"practice": 123,
"attachments": [
{
"entity_date": "2023-11-07T05:31:56Z",
"entity_description": "<string>",
"entity_id": 123,
"entity_type": 123,
"handout": 123,
"id": 123,
"summary": "<string>"
}
],
"body": "<string>",
"category": 123,
"created_date": "2023-11-07T05:31:56Z",
"deleted_date": "2023-11-07T05:31:56Z",
"delivery_date": "2023-11-07T05:31:56Z",
"document_date": "2023-11-07T05:31:56Z",
"files": [
{
"base64_content": "<string>",
"content_type": "<string>",
"document": "<string>",
"external_content": "<unknown>",
"id": 123,
"original_filename": "<string>"
}
],
"id": 123,
"is_patient_initiated": true,
"is_processed": true,
"letter_type": "<string>",
"patient_read_time": "2023-11-07T05:31:56Z",
"send_out": true,
"send_to_patient": true,
"sign_date": "2023-11-07T05:31:56Z",
"signed_by": 123,
"subject": "<string>",
"tags": [
123
],
"viewed_at": "2023-11-07T05:31:56Z"
}Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Body
Show child attributes
Show child attributes
Files attached to this letter. Binary upload: set content_type='application/octet-stream' and provide 'base64_content' (and optional 'original_filename'). When any file uses base64, all files in the same request must use base64. On GET, returns file references.
Show child attributes
Show child attributes
The user who signed the letter.
200A list of Document Tags associated with the letter.
Response
Show child attributes
Show child attributes
Files attached to this letter. Binary upload: set content_type='application/octet-stream' and provide 'base64_content' (and optional 'original_filename'). When any file uses base64, all files in the same request must use base64. On GET, returns file references.
Show child attributes
Show child attributes
The user who signed the letter.
200A list of Document Tags associated with the letter.
Was this page helpful?
curl --request POST \
--url https://sandbox.elationemr.com/api/2.0/patient_letters/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"patient": 123,
"practice": 123,
"attachments": [
{
"entity_date": "2023-11-07T05:31:56Z",
"entity_description": "<string>",
"entity_id": 123,
"handout": 123,
"summary": "<string>"
}
],
"body": "<string>",
"delivery_date": "2023-11-07T05:31:56Z",
"document_date": "2023-11-07T05:31:56Z",
"files": [
{
"base64_content": "<string>",
"content_type": "<string>",
"document": "<string>",
"external_content": "<unknown>",
"original_filename": "<string>"
}
],
"is_patient_initiated": true,
"patient_read_time": "2023-11-07T05:31:56Z",
"send_out": true,
"sign_date": "2023-11-07T05:31:56Z",
"signed_by": 123,
"subject": "<string>",
"tags": [
123
],
"viewed_at": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://sandbox.elationemr.com/api/2.0/patient_letters/"
payload = {
"patient": 123,
"practice": 123,
"attachments": [
{
"entity_date": "2023-11-07T05:31:56Z",
"entity_description": "<string>",
"entity_id": 123,
"handout": 123,
"summary": "<string>"
}
],
"body": "<string>",
"delivery_date": "2023-11-07T05:31:56Z",
"document_date": "2023-11-07T05:31:56Z",
"files": [
{
"base64_content": "<string>",
"content_type": "<string>",
"document": "<string>",
"external_content": "<unknown>",
"original_filename": "<string>"
}
],
"is_patient_initiated": True,
"patient_read_time": "2023-11-07T05:31:56Z",
"send_out": True,
"sign_date": "2023-11-07T05:31:56Z",
"signed_by": 123,
"subject": "<string>",
"tags": [123],
"viewed_at": "2023-11-07T05:31:56Z"
}
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({
patient: 123,
practice: 123,
attachments: [
{
entity_date: '2023-11-07T05:31:56Z',
entity_description: '<string>',
entity_id: 123,
handout: 123,
summary: '<string>'
}
],
body: JSON.stringify('<string>'),
delivery_date: '2023-11-07T05:31:56Z',
document_date: '2023-11-07T05:31:56Z',
files: [
{
base64_content: '<string>',
content_type: '<string>',
document: '<string>',
external_content: '<unknown>',
original_filename: '<string>'
}
],
is_patient_initiated: true,
patient_read_time: '2023-11-07T05:31:56Z',
send_out: true,
sign_date: '2023-11-07T05:31:56Z',
signed_by: 123,
subject: '<string>',
tags: [123],
viewed_at: '2023-11-07T05:31:56Z'
})
};
fetch('https://sandbox.elationemr.com/api/2.0/patient_letters/', 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://sandbox.elationemr.com/api/2.0/patient_letters/",
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([
'patient' => 123,
'practice' => 123,
'attachments' => [
[
'entity_date' => '2023-11-07T05:31:56Z',
'entity_description' => '<string>',
'entity_id' => 123,
'handout' => 123,
'summary' => '<string>'
]
],
'body' => '<string>',
'delivery_date' => '2023-11-07T05:31:56Z',
'document_date' => '2023-11-07T05:31:56Z',
'files' => [
[
'base64_content' => '<string>',
'content_type' => '<string>',
'document' => '<string>',
'external_content' => '<unknown>',
'original_filename' => '<string>'
]
],
'is_patient_initiated' => true,
'patient_read_time' => '2023-11-07T05:31:56Z',
'send_out' => true,
'sign_date' => '2023-11-07T05:31:56Z',
'signed_by' => 123,
'subject' => '<string>',
'tags' => [
123
],
'viewed_at' => '2023-11-07T05:31:56Z'
]),
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://sandbox.elationemr.com/api/2.0/patient_letters/"
payload := strings.NewReader("{\n \"patient\": 123,\n \"practice\": 123,\n \"attachments\": [\n {\n \"entity_date\": \"2023-11-07T05:31:56Z\",\n \"entity_description\": \"<string>\",\n \"entity_id\": 123,\n \"handout\": 123,\n \"summary\": \"<string>\"\n }\n ],\n \"body\": \"<string>\",\n \"delivery_date\": \"2023-11-07T05:31:56Z\",\n \"document_date\": \"2023-11-07T05:31:56Z\",\n \"files\": [\n {\n \"base64_content\": \"<string>\",\n \"content_type\": \"<string>\",\n \"document\": \"<string>\",\n \"external_content\": \"<unknown>\",\n \"original_filename\": \"<string>\"\n }\n ],\n \"is_patient_initiated\": true,\n \"patient_read_time\": \"2023-11-07T05:31:56Z\",\n \"send_out\": true,\n \"sign_date\": \"2023-11-07T05:31:56Z\",\n \"signed_by\": 123,\n \"subject\": \"<string>\",\n \"tags\": [\n 123\n ],\n \"viewed_at\": \"2023-11-07T05:31:56Z\"\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://sandbox.elationemr.com/api/2.0/patient_letters/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"patient\": 123,\n \"practice\": 123,\n \"attachments\": [\n {\n \"entity_date\": \"2023-11-07T05:31:56Z\",\n \"entity_description\": \"<string>\",\n \"entity_id\": 123,\n \"handout\": 123,\n \"summary\": \"<string>\"\n }\n ],\n \"body\": \"<string>\",\n \"delivery_date\": \"2023-11-07T05:31:56Z\",\n \"document_date\": \"2023-11-07T05:31:56Z\",\n \"files\": [\n {\n \"base64_content\": \"<string>\",\n \"content_type\": \"<string>\",\n \"document\": \"<string>\",\n \"external_content\": \"<unknown>\",\n \"original_filename\": \"<string>\"\n }\n ],\n \"is_patient_initiated\": true,\n \"patient_read_time\": \"2023-11-07T05:31:56Z\",\n \"send_out\": true,\n \"sign_date\": \"2023-11-07T05:31:56Z\",\n \"signed_by\": 123,\n \"subject\": \"<string>\",\n \"tags\": [\n 123\n ],\n \"viewed_at\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.elationemr.com/api/2.0/patient_letters/")
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 \"patient\": 123,\n \"practice\": 123,\n \"attachments\": [\n {\n \"entity_date\": \"2023-11-07T05:31:56Z\",\n \"entity_description\": \"<string>\",\n \"entity_id\": 123,\n \"handout\": 123,\n \"summary\": \"<string>\"\n }\n ],\n \"body\": \"<string>\",\n \"delivery_date\": \"2023-11-07T05:31:56Z\",\n \"document_date\": \"2023-11-07T05:31:56Z\",\n \"files\": [\n {\n \"base64_content\": \"<string>\",\n \"content_type\": \"<string>\",\n \"document\": \"<string>\",\n \"external_content\": \"<unknown>\",\n \"original_filename\": \"<string>\"\n }\n ],\n \"is_patient_initiated\": true,\n \"patient_read_time\": \"2023-11-07T05:31:56Z\",\n \"send_out\": true,\n \"sign_date\": \"2023-11-07T05:31:56Z\",\n \"signed_by\": 123,\n \"subject\": \"<string>\",\n \"tags\": [\n 123\n ],\n \"viewed_at\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"patient": 123,
"practice": 123,
"attachments": [
{
"entity_date": "2023-11-07T05:31:56Z",
"entity_description": "<string>",
"entity_id": 123,
"entity_type": 123,
"handout": 123,
"id": 123,
"summary": "<string>"
}
],
"body": "<string>",
"category": 123,
"created_date": "2023-11-07T05:31:56Z",
"deleted_date": "2023-11-07T05:31:56Z",
"delivery_date": "2023-11-07T05:31:56Z",
"document_date": "2023-11-07T05:31:56Z",
"files": [
{
"base64_content": "<string>",
"content_type": "<string>",
"document": "<string>",
"external_content": "<unknown>",
"id": 123,
"original_filename": "<string>"
}
],
"id": 123,
"is_patient_initiated": true,
"is_processed": true,
"letter_type": "<string>",
"patient_read_time": "2023-11-07T05:31:56Z",
"send_out": true,
"send_to_patient": true,
"sign_date": "2023-11-07T05:31:56Z",
"signed_by": 123,
"subject": "<string>",
"tags": [
123
],
"viewed_at": "2023-11-07T05:31:56Z"
}