Skip to main content
POST
/
public
/
v1
/
patient-plans
/
Create Patient Plan
curl --request POST \
  --url https://app.silnahealth.com/api/public/v1/patient-plans/ \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "member_number": "<string>",
  "payor_entity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "patient_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "plan_order_number": 123,
  "group_number": null,
  "start_date": null,
  "end_date": null,
  "insurance_type": null,
  "source_id": null,
  "insurance_card_file_id": null,
  "insurance_card_back_file_id": null,
  "conflict_behavior": "RAISE_ERROR"
}
'
import requests

url = "https://app.silnahealth.com/api/public/v1/patient-plans/"

payload = {
"member_number": "<string>",
"payor_entity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"patient_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"plan_order_number": 123,
"group_number": None,
"start_date": None,
"end_date": None,
"insurance_type": None,
"source_id": None,
"insurance_card_file_id": None,
"insurance_card_back_file_id": None,
"conflict_behavior": "RAISE_ERROR"
}
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({
member_number: '<string>',
payor_entity_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
patient_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
plan_order_number: 123,
group_number: null,
start_date: null,
end_date: null,
insurance_type: null,
source_id: null,
insurance_card_file_id: null,
insurance_card_back_file_id: null,
conflict_behavior: 'RAISE_ERROR'
})
};

fetch('https://app.silnahealth.com/api/public/v1/patient-plans/', 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://app.silnahealth.com/api/public/v1/patient-plans/",
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([
'member_number' => '<string>',
'payor_entity_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'patient_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'plan_order_number' => 123,
'group_number' => null,
'start_date' => null,
'end_date' => null,
'insurance_type' => null,
'source_id' => null,
'insurance_card_file_id' => null,
'insurance_card_back_file_id' => null,
'conflict_behavior' => 'RAISE_ERROR'
]),
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://app.silnahealth.com/api/public/v1/patient-plans/"

payload := strings.NewReader("{\n \"member_number\": \"<string>\",\n \"payor_entity_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"patient_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"plan_order_number\": 123,\n \"group_number\": null,\n \"start_date\": null,\n \"end_date\": null,\n \"insurance_type\": null,\n \"source_id\": null,\n \"insurance_card_file_id\": null,\n \"insurance_card_back_file_id\": null,\n \"conflict_behavior\": \"RAISE_ERROR\"\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://app.silnahealth.com/api/public/v1/patient-plans/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"member_number\": \"<string>\",\n \"payor_entity_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"patient_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"plan_order_number\": 123,\n \"group_number\": null,\n \"start_date\": null,\n \"end_date\": null,\n \"insurance_type\": null,\n \"source_id\": null,\n \"insurance_card_file_id\": null,\n \"insurance_card_back_file_id\": null,\n \"conflict_behavior\": \"RAISE_ERROR\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://app.silnahealth.com/api/public/v1/patient-plans/")

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 \"member_number\": \"<string>\",\n \"payor_entity_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"patient_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"plan_order_number\": 123,\n \"group_number\": null,\n \"start_date\": null,\n \"end_date\": null,\n \"insurance_type\": null,\n \"source_id\": null,\n \"insurance_card_file_id\": null,\n \"insurance_card_back_file_id\": null,\n \"conflict_behavior\": \"RAISE_ERROR\"\n}"

response = http.request(request)
puts response.read_body
{
  "patient_plan_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
{
"message": "<string>"
}
{
"message": "<string>"
}
{
"message": "<string>"
}
{
"message": "<string>"
}
{
"message": "<string>"
}

How to get the payor_entity_id

Use the Get Payors API.

Handling Conflicts

Using the conflict_behavior field allows you to configure how existing plans are handled when a patient plan already exists at the specified plan_order_number.
  • The default is RAISE_ERROR and will return a Conflict Error (http status of 409)
  • BUMP_ONE will move the existing plan at the specified order to the next order number. For example, if you create a new primary plan (order 1) and a primary plan already exists, the existing plan will be moved to secondary (order 2). Note that this will fail with a Conflict Error (409) if the next order number is also occupied.

Create Patient Plan With Insurance Card

If you want to create a patient plan with an insurance card, you will need to do the following steps:
  1. Upload the front of the insurance card to the File Upload API and get the file_id from the response.
  2. Upload the back of the insurance card to the File Upload API and get the file_id from the response.
  3. Make a post request to this api with the file_ids returned from 1 and 2 as the insurance_card_file_id and insurance_card_back_file_id, respectively.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
Request schema for creating a patient plan

Request schema for creating a patient plan

member_number
string
required
Required string length: 2 - 80
payor_entity_id
string<uuid>
required
patient_id
string<uuid>
required
plan_order_number
integer
required

The order number of the plan (1 for primary, 2 for secondary, etc)

group_number
string | null
Required string length: 2 - 80
start_date
string<date-time> | null
end_date
string<date-time> | null
insurance_type
enum<string> | null

The type of insurance

Available options:
COMMERCIAL,
MEDICARE,
MEDICAID,
REGIONAL_CENTER,
WORKERS_COMPENSATION,
AUTO_INSURANCE
source_id
string | null

Unique identifier for the patient plan. This is (optionally) generated and supplied by API clients

insurance_card_file_id
string<uuid> | null

The file ID corresponding to the front of the insurance card

insurance_card_back_file_id
string<uuid> | null

The file ID corresponding to the back of the insurance card

conflict_behavior
enum<string> | null
default:RAISE_ERROR

How to handle a conflict when a patient plan already exists at the specified plan_order_number. RAISE_ERROR (default) will return a 409 Conflict error. BUMP_ONE will move the existing plan at the specified order to the next order number (e.g., primary becomes secondary).

Available options:
RAISE_ERROR,
BUMP_ONE

Response

Response schema for creating a patient plan

Response schema for creating a patient plan

patient_plan_id
string<uuid>
required